<?php

namespace App\Http\Validate\Purchase;

use App\Http\Validate\BaseValidate;

/**
 * 权限组验证器
 */
class PurchaseWarehousingOrder extends BaseValidate
{
    //验证规则
    protected $rule = [];
    //自定义验证信息
    protected $message = [];

    public function __construct($doaction = 'subedit')
    {
        if ($doaction == 'subedit') {
            $this->rule = [
                'id'=>'required',
                'stock_id'=>'required',
                'count' => 'required|integer|gt:0',
            ];
            $this->message = [
                'id.required' => '参数错误',
                'stock_id.required' => '库存信息未选择',
                'count.required' => '订单件数不能为空',
                'count.integer' => '订单件数不可小于0',
                'count.gt' => '订单件数不可小于0',
            ];
        }
    }
}
